
define(['ionic', 'directives'], function () {
    angular.module('U9Mobile.directives')
        .directive('feedbackMsg', function () {
            return {
                restrict: 'E',
                scope: {
                    message: '='
                },
                transclude: true,
                replace: true,
                template:
                '<div class="feed-back-msg">' +
                    '<img class="photo" ng-src="{{message.photo}}">' +
                    '<div class="content">{{message.message}}</div>' +
                    '<div class="arrow"></div>' +
                '</div>',
                link: function ($scope, $element, $attr) {
                    if (angular.isDefined($attr.received) && $attr.received === 'true') {
                        $element.addClass('feed-back-msg-left');
                    } else {
                        $element.addClass('feed-back-msg-right');
                    }
                }
            };
        });
});
